﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NFine.Application.Biz;
using NFine.Code;

namespace NFine.Web.Areas.BizManage.Controllers
{
    public class TransferCenterOrderController : Controller
    {
        //
        // GET: /BizManage/TransferCenterOrder/

        private UserOrderApp orderApp = new UserOrderApp();

        public ActionResult Index()
        {
            return View();
        }


        /// <summary>
        /// 获取订单列表
        /// </summary>
        /// <param name="pagination"></param>
        /// <returns></returns>
        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetGridJson(Pagination pagination, int Type, string OrderCode, string Consignee,
            string OrderTimeStart, string OrderTimeEnd)
        {
            var data = new
            {
                rows =
                orderApp.GetListForTransferCenter(pagination, Type, OrderCode, Consignee, OrderTimeStart, OrderTimeEnd, OperatorProvider.Provider.GetCurrent().IsSystem ? string.Empty : OperatorProvider.Provider.GetCurrent().UserId),
                total = pagination.total,
                page = pagination.page,
                records = pagination.records
            };
            return Content(data.ToJson());
        }

    }
}
